const mongoose = require("mongoose");

const schema = new mongoose.Schema(
  {
    title: String,
    thumbnail: String,
    body: String,
    user: { type: mongoose.SchemaTypes.ObjectId, ref: "User" },
    classify: { type: mongoose.SchemaTypes.ObjectId, ref: "Classify" },
    tag: [{ type: mongoose.SchemaTypes.ObjectId, ref: "Tag" }],
  },
  { timestamps: true, versionKey: false }
);

module.exports = mongoose.model("Document", schema);
